//
//  Book.m
//  03_homework_NSString NSArray NSMutableArray
//
//  Created by dllo on 16/7/6.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "Book.h"

// 改变价格是Book类的
@implementation Book

- (instancetype)initWithName:(NSString *)name price:(double)price {
    self = [super init];
    if (self) {
        _name = name;
        _price = price;
    }
    return self;
}

+ (instancetype)bookWithName:(NSString *)name price:(double)price {
    return [[Book alloc] initWithName:name price:price];
}

- (NSString *)description {
    return [NSString stringWithFormat:@"bookName:%@, price:%.2lf", _name, _price];
}

@end
